﻿@model IEnumerable<DLM.Domain.DTO.InvitationDTO>
@using Webdiyer.WebControls.Mvc;
<script type="text/javascript">
    $(document).ready(function () {
        $("ul.clearfix li").mouseover(function () {

            $(this).addClass("hover");
        });
        $("ul.clearfix li").mouseout(function () {

            $(this).removeClass("hover");
        });
        $("a").css("cursor", "pointer");
    });
</script>
<ul class="clearfix">
    @foreach (var item in Model)
    {

        
         
        <li>
            <div class="friend_item">
                <div class="friend_pic">
                    @if (item.SenderPhoto == "none_75_75.png")
                    {
                        <a href="@Url.Action("View", "User", new { id = item.SenderID })">
                            <img src="@Url.Content("~/Content/ad/none_75_75.png")" alt="头像" height="77px" width="77px"/>
                        </a>
                    }
                    else
                    {   
                        <a href="@Url.Action("View", "User", new { id = item.SenderID })">
                            <img src="@Url.Content("~/Files/Photos/" + item.SenderID + "/Title/" + item.SenderPhoto)" alt="" /></a>
                    }
                </div>
                <div class="friend_info">
                    <a href="@Url.Action("View", "User", new { id = item.SenderID })">@item.SenderAccount</a></div>
                <div class="friend_act">
                    <div class="friend_act_left">
                        <a href="@Url.Action("View", "Party", new { id = item.PartyID })">查看活动</a>
                    </div>
                    @if (!item.IsConfirmed)
                    {  <div class="friend_act_right">
                        @using (Ajax.BeginForm("ConfrimInvite", "Party", new { id = item.InvitationID },
                                    new AjaxOptions
                                    {
                                        HttpMethod = "Post",
                                        UpdateTargetId = "divMyInvitationRequest",
                                        OnSuccess = "onInvitateSuccessed",
                                        OnFailure = "onInvitateFalied"
                                    }))
                        {
                            <input type="submit" value="同意" class="btn" />
                        }
                    </div>
                    }
                </div>
            </div>
        </li>  
   
    }
</ul>
<div class="paging">
@Ajax.Pager(Model as PagedList<DLM.Domain.DTO.InvitationDTO>, new PagerOptions
{
    PageIndexParameterName = "invitateid",
    CurrentPagerItemWrapperFormatString = "<span class=\"current\">{0}</span>",
    //NumericPagerItemWrapperFormatString = "<a>{0}</a>",
    PrevPageText = "<",
    NextPageText = ">",
    ShowNumericPagerItems = true,
    ShowFirstLast = false,
    ShowPrevNext = true,
    CssClass = "scott",
    MorePageText = "...",
    SeparatorHtml = ""
},
            new AjaxOptions { UpdateTargetId = "divMyInvitation" }
    )
</div>
